home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
010
/
seven.asc
< prev
next >
Wrap
Text File
|
1985-06-03
|
8KB
|
286 lines
0 D$="SHCD"
20 DIM C(52),P(8),S(5),V(8)
30 DIM A$(26),D$(4),S$(32)
32 TEXT : CALL -936
35 POKE 50,255
40 PRINT : PRINT "*** SEVEN ***"
50 PRINT : PRINT "DO YOU NEED THE RULES (Y OR N)?"
60 GOSUB 3000
70 IF K= ASC("N") THEN 280
72 GOSUB 5000
75 PRINT
80 PRINT " 'SEVEN' IS PRIMARILY THE EUROPEAN VERSION OF 'CRAZY EIGHTS', MODIFIED WITH A FEW MORE INTERESTING RULES."
85 PRINT
90 PRINT " BASICALLY, THE OBJECT OF THE GAME IS TO GET RID OF ALL YOUR CARDS BY FOLLOWING SUIT OR RANK OF THE 'SHOW'"
100 PRINT "CARD. PLAY CONTINUES LIKEWISE UNTIL A QUEEN ('Q') IS PLAYED. THEN ITS OWNER MAY NAME THE SUIT OF HIS CHOICE."
105 PRINT
110 PRINT " THE PLAY OF AN ACE ('A') CAUSES THE NEXT PLAYER TO BE SKIPPED, AND IF YOU CANNOT PLAY, YOU MUST DRAW ONE CARD."
115 PRINT
120 PRINT " IF A SEVEN ('7') IS PLAYED, EACH CONSECUTIVE PLAYER MUST PLAY A '7' UNTIL SOMEONE DOESN'T HAVE ONE."
130 PRINT "THIS PLAYER MUST THEN DRAW 3 CARDS FOR EVERY SEVEN PLAYED BEFORE HIM."
140 PRINT : PRINT " HIT ANY KEY TO CONTINUE...";
145 GOSUB 3000: GOSUB 5000
150 PRINT "EACH HAND IS DEALT SIX CARDS.": PRINT : PRINT "LOW SCORE WINS, WITH ...": PRINT
160 TAB 10: PRINT "7 ... 10 POINTS": TAB 10: PRINT "Q ... 5 POINTS"
165 TAB 10: PRINT "A ... 3 POINTS": TAB 6: PRINT "OTHER ... 1 POINT"
170 PRINT : PRINT "ENTER YOUR PLAYS IN THE FORM '2D' FOR 2-DIAMONDS, OR '10H' FOR 10-HEARTS."
180 PRINT "(NUMBER, 'A', 'J', 'Q', OR 'K' FOLLOWED BY THE FIRST LETTER OF THE SUIT NAME)": PRINT
190 PRINT "IF YOU CAN'T FOLLOW SUIT OR MATCH THE RANK OF THE LAST CARD PLAYED (AND YOU"
200 PRINT "DON'T HAVE A QUEEN), TYPE 'D' TO DRAW A CARD. ALSO, WATCH OUT FOR THOSE 7'S!"
210 PRINT : PRINT "YOU'LL BE PLAYING HAND 1, AND I'LL PLAY THE OTHER HANDS AGAINST YOU. GOOD LUCK!"
280 FOR P1=1 TO 8
290 V(P1)=0
300 NEXT P1
310 PRINT
320 PRINT "HOW MANY PLAYERS (FROM 2 TO 8)?";
330 GOSUB 3000
335 N=K- ASC("0")
340 IF N<2 OR N>8 THEN 330
345 POKE 50,63
350 A=0:F7=0:HNDNO=HNDNO+1
355 CALL -936
360 R=52
365 TAB 3: PRINT "< SHUFFLING >"
380 A$=" A 2 3 4 5 6 7 8 910 J Q K"
390 S$="SPADES HEARTS CLUBS DIAMONDS"
400 D=1
410 FOR I=1 TO 52:C(I)=0: NEXT I
420 FOR P1=1 TO 8
430 P(P1)=6
440 NEXT P1
450 VTAB 24
460 FOR L0=1 TO N
470 FOR L1=1 TO 6
480 GOSUB 2200
490 C((Y-1)*4+X)=L0
520 NEXT L1,L0
530 GOSUB 4000
540 GOSUB 2200
550 IF Y=1 THEN A=1
570 IF Y=7 THEN F7=1
590 PRINT "START ---> ";
600 GOSUB 2050
610 S1=X
620 S2=Y
630 REM BEGIN
640 GOSUB 4000
650 D=D+1
660 Q1=0:Q2=0
670 IF D>N THEN D=D-N
680 IF S2#1 OR A=0 THEN 730
700 PRINT "HAND # ";D;" : SKIPPED "
710 A=0
720 GOTO 640
730 IF D=1 THEN 1260
740 X=1
750 Y=1
760 IF C((Y-1)*4+X)#D THEN 880
770 IF S2#7 THEN 830
780 IF Y=7 THEN 810
790 IF F7=0 THEN 830
800 GOTO 880
810 F7=F7+1
820 GOTO 960
830 IF X=S1 OR Y=S2 THEN 930
850 IF Y#12 THEN 880
860 Q1=X
870 Q2=Y
880 Y=Y+1: IF Y<=13 THEN 760
890 X=X+1: IF X<=4 THEN 750
900 X=Q1
910 Y=Q2
920 GOTO 970
930 REM PLAY
940 IF Y=7 THEN F7=1
960 Q1=0:Q2=0
970 PRINT "HAND # ";D;" : ";
980 IF X#0 THEN 1040
990 PRINT " DRAWS ";
1000 GOSUB 2080
1005 IF M>9 THEN 1020
1010 PRINT M;" "
1015 GOTO 630
1020 PRINT M
1030 GOTO 630
1040 GOSUB 2050
1050 C((Y-1)*4+X)=-1
1060 IF Q1#0 AND D#1 THEN 1080
1070 IF Y#12 OR D=1 THEN 1210
1080 FOR I=1 TO 5:S(I)=0: NEXT I
1090 FOR X1=1 TO 4
1100 FOR Y1=1 TO 13
1110 IF C((Y1-1)*4+X1)=D THEN S(X1)=S(X1)+1
1130 NEXT Y1,X1
1150 FOR X1=1 TO 4
1160 IF S(X1)<=S(5) THEN 1190
1170 S(5)=S(X1)
1180 X=X1
1190 NEXT X1
1200 PRINT " CALL: ";S$(X*8-7,X*8)
1210 P(D)=P(D)-1
1220 IF P(D)=0 THEN 2380
1230 IF Y#1 THEN 610
1240 A=1
1250 GOTO 610
1260 REM INPUT
1270 PRINT "YOUR PLAY: ";
1280 GOSUB 3000
1320 IF K# ASC("D") THEN 1360
1330 TAB 12: PRINT " DRAWS ";
1340 GOSUB 2080: PRINT M;: IF M<10 THEN PRINT " ";: PRINT
1350 GOTO 630
1360 IF K# ASC("1") THEN 1400
1370 TAB 12
1380 PRINT "1";
1390 GOTO 1280
1400 L0=0
1410 L0=L0+1
1420 IF K= ASC(A$(L0*2)) THEN 1670
1430 IF L0<13 THEN 1410
1435 TAB 12
1440 PRINT "? ";
1445 GOTO 1280
1670 Y=L0: TAB 12
1675 PRINT A$(Y*2-1,Y*2);" ";
1680 GOSUB 3000
1685 L0=0
1690 L0=L0+1
1700 IF K= ASC(D$(L0)) THEN 1730
1710 IF L0<4 THEN 1690
1720 GOTO 1435
1730 X=L0
1740 PRINT S$(X*8-7,X*8)
1750 IF C((Y-1)*4+X)=1 THEN 1790
1770 PRINT "> PLAY YOUR OWN CARDS!"
1780 GOTO 1270
1790 IF X=S1 OR Y=S2 THEN 1840
1800 IF Y=12 THEN 1840
1820 PRINT "> FOLLOW SUIT OR RANK!"
1830 GOTO 1270
1840 REM OK
1860 IF S2=7 THEN 1980
1870 IF Y=7 THEN 1990
1880 IF Y#12 THEN 1050
1890 C((Y-1)*4+X)=-1
1900 PRINT " CALL: ";
1910 GOSUB 3000
1915 L0=0
1920 L0=L0+1
1930 IF K= ASC(D$(L0)) THEN 1960
1940 IF L0<4 THEN 1920
1950 GOTO 1910
1960 X=L0
1965 PRINT S$(X*8-7,X*8)
1970 GOTO 1210
1980 IF Y#7 THEN 2010
1990 F7=F7+1
2000 GOTO 1050
2010 IF F7=0 THEN 1880
2020 PRINT "> PLAY A '7' OR DRAW!!"
2030 GOTO 1270
2050 REM PRINT
2060 PRINT A$(Y*2-1,Y*2);" ";S$(X*8-7,X*8)
2070 RETURN
2080 REM DRAW
2090 M=F7*3: IF M<1 THEN M=1
2095 M1=M
2100 FOR T=1 TO M1
2110 GOSUB 2200
2115 IF M#M1 THEN 2160
2120 C((Y-1)*4+X)=D
2160 NEXT T
2170 P(D)=P(D)+M
2180 F7=0
2190 RETURN
2200 REM DEAL
2210 IF R#0 THEN 2320
2220 PRINT "";
2230 FOR X1=1 TO 52
2250 IF C(X1)#-1 THEN 2280
2260 C(X1)=0
2270 R=R+1
2280 NEXT X1
2290 C((S2-1)*4+S1)=-1
2300 R=R-1
2305 IF R>0 THEN 2320
2310 M=M-1
2315 RETURN
2320 X= RND (4)+1
2325 Z= RND (4)
2330 Y= RND (13)+1
2340 IF C((Y-1)*4+X)#0 THEN 2320
2350 C((Y-1)*4+X)=-1
2360 R=R-1
2370 RETURN
2380 PRINT : PRINT "**** HAND ";D;" WINS! ****": GOSUB 4000: FOR I=1 TO 1000: NEXT I
2385 POKE 32,0: POKE 33,40: CALL -936
2400 FOR Z=1 TO N
2410 R=0
2420 IF Z=1 THEN 2450
2425 PRINT
2430 PRINT "HAND # ";Z;" : ";
2440 GOTO 2460
2450 PRINT "YOUR HAND: ";
2460 FOR X=1 TO 4
2470 FOR Y=1 TO 13
2480 IF C((Y-1)*4+X)#Z THEN 2570
2490 GOSUB 2050:R=R+1
2500 PRINT " ";
2510 IF Y=1 THEN R=R+2
2530 IF Y=7 THEN R=R+9
2550 IF Y=12 THEN R=R+4
2570 NEXT Y,X
2575 PRINT "-----------": PRINT " ";
2580 IF R#1 THEN 2595
2585 PRINT " 1 POINT "
2590 GOTO 2605
2595 IF R<10 THEN PRINT " ";
2600 PRINT R;" POINTS "
2605 V(Z)=V(Z)+R
2620 NEXT Z
2630 POKE 32,25: POKE 33,15
2670 VTAB 1
2674 IF HNDNO>9 THEN 2680
2675 IF HNDNO=1 THEN 2681
2679 PRINT "AFTER ";HNDNO;" HANDS": GOTO 2689
2680 PRINT "AFTER ";HNDNO;" HANDS": GOTO 2689
2681 PRINT "AFTER ";HNDNO;" HAND"
2689 PRINT "--------------"
2690 FOR Z=1 TO N
2700 PRINT " "
2710 IF Z>1 THEN 2740
2720 PRINT "YOUR HAND: ";
2730 GOTO 2745
2740 PRINT "HAND # ";Z;" : ";
2745 IF V(Z)<100 THEN PRINT " ";
2750 IF V(Z)<10 THEN PRINT " ";
2755 PRINT V(Z)
2760 NEXT Z
2770 PRINT " "
2775 VTAB 23
2780 PRINT "ANOTHER HAND ?";
2790 POKE 32,0: POKE 33,40
2800 GOSUB 3000
2810 IF K# ASC("N") THEN 350
2830 POKE 50,255
2840 CALL -936
2850 END
3000 REM KEYBOARD INPUT
3010 K= PEEK (-16384)
3020 IF K<128 THEN 3010
3030 POKE -16368,0
3040 RETURN
4000 REM LIST HAND
4010 POKE 32,28: POKE 33,12
4020 VTAB 1
4025 PRINT "HAND:#CARDS": PRINT "-----------"
4030 FOR X=1 TO N: PRINT "HAND ";X;" : ";: IF P(X)<10 THEN PRINT " ";: PRINT P(X): NEXT X: CALL -868: PRINT
4040 IF D#1 THEN 4080: PRINT " YOUR HAND ": PRINT "-----------"
4050 FOR X=1 TO 4: FOR Y=1 TO 13: IF C((Y-1)*4+X)=1 THEN GOSUB 2050: NEXT Y,X: CALL -958
4080 POKE 32,2: POKE 33,24
4090 VTAB 24: RETURN
5000 POKE 50,63: VTAB 1: TAB 1: FOR I=1 TO 23: PRINT " ";: NEXT I: VTAB 1: RETURN
N
5000 POKE 50,63: VTAB 1: TAB 1: FOR I=1 TO 23: PRINT " ";: NEXT I: VTAB 1: RETURN
N
5000 POKE 50,63: VTAB 1: TAB 1: FOR I=1 TO 23: PRINT "